import Vue from 'vue'
import Router from 'vue-router'
import Home from './components/Home.vue'
import Homepage from './components/Homepage.vue'
import Getstart from './components/Getstart.vue'
import Api from './components/Api.vue'
import About from './components/About.vue'
import Signup from './components/Signup.vue'
import Signin from './components/Signin.vue'
import Top from './components/Top.vue'
import TopicDetails from './components/TopicDetails.vue'

Vue.use(Router)

const router = new Router({
  mode: 'history',
  routes: [
    { path: '/', redirect: '/homepage' },
    {
      path: '/home',
      component: Home,
      redirect: '/homepage',
      children: [
        { path: '/homepage', component: Homepage },
        { path: '/getstart', component: Getstart },
        { path: '/api', component: Api },
        { path: '/about', component: About },
        { path: '/signup', component: Signup },
        { path: '/signin', component: Signin },
        { path: '/users/top100', component: Top },
        { path: '/topic/:id', component: TopicDetails }
      ]
    }
  ]
})
export default router
